package com.zys.el.time.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zys.el.time.entity.Deal;
import com.zys.el.time.mapper.DealMapper;
import com.zys.el.time.service.IDealService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DealService extends ServiceImpl<DealMapper, Deal> implements IDealService {
    public List<Deal> getDealList(String userId) {
        Long id = Long.valueOf(userId);
        return getBaseMapper().getListByUserIdLogic(id);
    }

    @Override
    public Deal getByDealNameLogic(Long userId, String title) {
        return query().eq("user_id", userId).eq("title", title).one();
    }
}
